<template>
    <div>
        <div class="banner" @click="ifshowGallary">
            <img class="banner-img" :src="this.bannerImg" alt="">
            <div class="banner-info">
                <div class="banner-title">
                    {{this.sightName}}
                </div>
                <div class="banner-num">
                    <span class="iconfont banner-icon">&#xe626;</span>
                    {{this.gallaryImgs.length}}
                </div>
            </div>
        </div>
        <fade>
            <gallary v-show="showGallary" @close='closeGallary' :imges = 'this.gallaryImgs'></gallary>
        </fade>
    </div>
</template>

<script>
/* eslint-disable */
import gallary from 'common/gallary/gallary'
import fade from 'common/fade/fade'
export default {
    name: 'detailBanner',
    components: {
        gallary,
        fade
    },
    props: {
        sightName: String,
        bannerImg: String,
        gallaryImgs: Array
    },
    data() {
        return {
            showGallary: false
        }
    },
    methods: {
        ifshowGallary(){
            this.showGallary = true
        },
        closeGallary(){
            this.showGallary = false
        }
    }
}
</script>

<style lang="stylus" scoped>
    .banner
        position relative
        width 100%
        height 0
        padding-bottom 55%
        .banner-img
            width 100%
        .banner-info
            position absolute
            display flex
            left 0
            right 0
            bottom 0
            line-height .6rem
            color #ffffff
            background-image linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,.8))
            .banner-title
                flex 1
                font-size .32rem
                padding 0 .2rem
            .banner-num
                height .32rem
                line-height .32rem
                margin-top .14rem
                padding 0 .4rem
                font-size .24rem
                background rgba(0,0,0,.8)
                border-radius .2rem
                .banner-icon
                    font-size .24rem


</style>